package cn.amarone.scaffold.entity;

import cn.amarone.scaffold.entity.dict.StatusEnum;
import com.mybatisflex.annotation.*;
import com.mybatisflex.core.keygen.KeyGenerators;
import com.mybatisflex.core.mask.Masks;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @author Amarone
 * @version 1.0
 * @description:
 * @date 2023/7/31 14:08
 */
@Getter
@Setter
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Table(value = "sys_user", camelToUnderline = true)
public class SysUser {

    @Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
    @Schema(description = "用户ID", example = "43536994589908992")
    private Long id;

    @Schema(description = "用户昵称", example = "Amarone")
    private String nickName;

    @ColumnMask(Masks.MOBILE)
    @Schema(description = "用户联系手机号", example = "19365410929")
    private String mobilePhoneNumber;

    @ColumnMask(Masks.ADDRESS)
    @Schema(description = "用户联系地址", example = "云南省怒江傈僳族自治州泸水市片马镇")
    private String addres;

    @ColumnMask(Masks.EMAIL)
    @Schema(description = "邮箱", example = "1301@219g.vip")
    private String email;

    @ColumnMask(Masks.CHINESE_NAME)
    @Schema(description = "真实姓名", example = "邵雨泽")
    private String userName;

    @Schema(description = "年龄")
    private Integer age;

    @Schema(description = "生日", example = "2023年8月1日")
    private String birthday;

    @Column(tenantId = true)
    private Long orgId;

    @Schema(description = "启用标志")
    private StatusEnum status;
    @Schema(description = "读取标志位")
    @Column(version = true)
    private Long version;
    @Schema(description = "创建日期")
    @Column(onInsertValue = "now()")
    private Date createTime;
    @Schema(description = "创建者")
    private Long createBy;
    @Schema(description = "修改日期")
    @Column(onUpdateValue = "now()")
    private Date updateTime;
    @Schema(description = "修改者")
    private Long updateBy;
    @Schema(description = "删除标记")
    @Column(isLogicDelete = true)
    private Integer deleteFlag;
}
